#!/bin/bash
trap "" INT
i=1
fa="fileaddress"
if [ `id -u` -ne 0 ]
then
echo "请root账号登录运行这个程序"
exit 1
fi
find / -type f -perm +6000 > $fa
filesum=`cat $fa | wc -l`
while [ "$i" -le "$filesum" ]
do
FILENAME=`sed -n "${i}p" $fa`
echo "是否修改这个文件的s特权属性:$FILENAME,输入：Y 或 N，或者输入Q退出程序"
read choice
while [ "$choice" != "Y" -a "$choice" != "N" -a "$choice" != "Q" ]
do
echo "输入错误，重新输入"
echo "是否修改这个文件的s特权属性:$FILENAME,输入：Y 或 N，或者输入Q退出程序"
read choice
done
if [ "$choice" = "Y" ]
then
chmod a-s $FILENAME
echo "修改成功"
fi
if [ "$choice" = "N" ]
then
echo "修改下一个文件权限"
fi
if [ "$choice" = "Q" ]
then
exit 1
fi
((i++))
done
trap : INT

